<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>魏远商城</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<link rel="shortcut icon" href="/favicon.ico">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="css/sm.css">
		<link rel="stylesheet" href="css/sm-extend.css">
		<link rel="stylesheet" href="css/ionicons.css">
		<!--<link rel="stylesheet" href="css/iconfont.css">-->
		<link rel="stylesheet" href="css/my-collect.css">

	</head>

	<body>
		<div class="page-group">
			<div class="page page-current">
				<!--标题栏-->
				<header class="bar bar-nav">
					<a class="button button-link ion-chevron-left pull-left back"></a>
					<!--<a class="button button-link iconfont icon-shuaxin1 pull-right"></a>-->
					<h1 class="title">我的收藏</h1>
				</header>
				<!--这里是页面内容区域-->
				<div class="content">
					
				</div>
				<!--content end-->
			</div>
		</div>

		<script type="text/javascript" src="js/zepto.js" charset="UTF-8"></script>
		<script type="text/javascript" src="js/sm.min.js" charset="UTF-8"></script>
		<script type="text/javascript" src="js/sm-extend.min.js" charset="UTF-8"></script>
		<script type="text/javascript" src="js/common.js" charset="UTF-8"></script>
		<script src="js/url.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			//会员收藏
			collect();

			function collect() {
				console.log('开始调用接口')
				$.ajax({
					//				url:ur+'mobilemember/collectGoods/listCollection',
					url: 'http://wysc.tunnel.bbear.me:8000/wyshop/mobilemember/collectGoods/listCollection',
					type: 'post',
					dataType: 'json',
					headers: {
						'X-Token': 'D89AC7C0111D4C96A606798898DB734A'
					},
					data: '',
					success: function(data) {
//						alert(1);
						console.log(JSON.stringify(data.result.data) + '>>>>获取资料接口');
						var n = data.result.data.length;
						console.log(JSON.stringify(n));
						console.log(JSON.stringify(data.result.data[0].product.longname));
						console.log(JSON.stringify(data.result.data[0].product.mainImg));
						console.log(JSON.stringify(data.result.data[0].product.price));
						for(i = 0; i < n; i++) {
							var product = $('<div class="product">' +
								'<a class="p-img">' + '<img src="' + data.result.data[i].product.mainImg + '">' + '</a>' +
								'<div class="p-info">' +
								'<a class="p-name">' + data.result.data[i].product.longname + '</a>' +
								'<p class="clearfix">' +
								'<span class="pull-left">¥ <i>' + data.result.data[i].product.price + '</i></span>' +
								'<button class="pull-right">取消收藏</button>' +
								'</p>' +
								'</div>' +
								'</div>');
								$('.content').append(product);
						}
						
					},
					error: function(e) {
						console.log(JSON.stringify(e))
					}
				})
			}
		</script>
	</body>

</html>